﻿////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// <copyright>Copyright 2008-2011 Andreas Huber Doenni</copyright>
// Distributed under the Microsoft Public License (Ms-PL).
// See accompanying file License.txt or copy at http://mews.codeplex.com/license.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

namespace Mews
{
    using System.IO;

    /// <summary>Provides global settings used by the library.</summary>
    internal static class Settings
    {
        /// <summary>The default size of the temporary in-memory buffer that is allocated to read/write from a stream
        /// that retrieves/sends its data from/to memory.</summary>
        internal const int InMemoryStreamBufferSize = 1024;

        /// <summary>The initial size of the temporary in-memory buffer that is allocated to store message content
        /// (discrete entity body, multipart preamble, multipart epilogue).</summary>
        /// <remarks>Such a content buffer is repeatedly doubled in size when it runs out of space.</remarks>
        internal const int InitialContentBufferSize = 1024;

        /// <summary>The default size of the temporary in-memory buffer that is allocated to read/write from a stream
        /// that is presumed to retrieve/send its data directly from/to a physical resource, like a network or a file
        /// on a disk.</summary>
        /// <remarks>
        /// <para><b>Caution</b>: This size should not be smaller than the length of the longest line in the stream
        /// passed to a parsing method, like e.g. Mews.Mime.Message.Parse(Stream).
        /// <a href="http://www.ietf.org/rfc/rfc5322.txt">RFC 5322</a> 2.1.1. requires that lines must not be longer
        /// than 1000 characters, so keeping the value of this property at or above 1000 ensures that any conformant
        /// message can be parsed successfully.</para>
        /// </remarks>
        internal const int DefaultPhysicalStreamBufferSize = 8192;
    }
}
